package com.xxf.aynu.parking;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class newregister extends Activity {
    private Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_regist);
        button	=(Button) findViewById(R.id.register_register);
        button.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                EditText uname2 =(EditText)findViewById(R.id.register_username);
                EditText pw2 =(EditText)findViewById(R.id.register_password);
                EditText uid=(EditText)findViewById(R.id.register_id);
                EditText mail=(EditText)findViewById(R.id.register_mail);

                String Uname=uname2.getText().toString();
                String Pw=pw2.getText().toString();
                String mail1=mail.getText().toString();
                String uid1=uid.getText().toString();
                String httpUrl2="http://114.115.141.26/ParkingCar/UserRegister";
                String httpArg2="Uname="+uid1+"&"+"Utel="+Uname+"Umail="+mail1+"&"+"Upassword="+Pw;
                String jsonr1=Te.request2(httpUrl2, httpArg2);
                Toast.makeText(getApplicationContext(),"注册成功", Toast.LENGTH_SHORT).show();
                Intent intent=new Intent();
                intent.setClass(getApplicationContext(), newlogin.class);
                startActivity(intent);




            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }


}
